home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / HyperCuber 2.0 ƒ / HyperCuber Manual / HyperCuber Manual.rsrc / TEXT_134.txt < prev    next >
Text File  |  1994-05-03  |  9KB  |  101 lines

  1.  
  2. Viewpoints And Projections
  3.  
  4. This section explains in some depth exactly how HyperCuber defines n-dimensional viewpoints. It is not required reading if all you want to do is play with HyperCuber.
  5.  
  6. Viewpoints
  7. In order to completely describe a view of an object in four-space, you need to supply both the four-dimensional viewpoint of the object, and the three-dimensional viewpoint of the projection of the hypercube (See HyperCuber Projections for more information on projections). Similarly, to describe a view of an object in n-space, you need to specify an n-dimensional viewpoint, an (n-1)-dimensional viewpoint...down to the three-dimensional viewpoint. HyperCuber defines its three-dimensional viewpoint using spherical coordinates, and its higher-dimensional viewpoints using a coordinate system which is the logical higher-dimensional analog of spherical coordinates.
  8.  
  9. Viewing the three-dimensional projection is similar to viewing any other three-dimensional object; you can look at it from any point on an imaginary sphere surrounding it. You choose the viewpoint by changing the values of two angles, q (theta) and f (phi). Any viewpoint e on the sphere can be described using these angles. To convert the angles to a point in space, first take the x axis and rotate it f degrees around the y axis towards the positive z axis (in the xz plane). Then rotate it q degrees around the z axis towards the positive y axis (see Figure 1).
  10.  
  11.  ¬†
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. Increasing f raises the viewpoint off the xy plane towards positive z, and increasing q rotates the viewpoint counterclockwise around the z axis (looking down from positive z on the xy plane).
  27.  
  28. HyperCuber uses this system to describe a three-dimensional viewpoint. [3:1] is q, and [3:2] is f.
  29.  
  30. The four-dimensional viewpoint is described similarly, using ‚Äúhyperspherical‚Äù coordinates. A hypersphere, like a sphere, is the set of all points equidistant from a given point (the center), but a hypersphere is four-dimensional. Any point on an imaginary hypersphere surrounding the hypercube can be represented using hyperspherical coordinates. You choose the viewpoint by changing the values of three angles, a (alpha), b (beta), and g (gamma). Figure 2 shows the general setup, but I have not drawn in the locations of the angles, for reasons which will become clear:
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. To convert the angles to a point in four-space, first take the x axis and rotate it a degrees around the wz plane towards the positive y axis (in the xy plane). Then rotate it b degrees around the yw plane towards the positive z axis (in a plane parallel to the xz plane). Finally, rotate it g degrees around the yz plane towards the positive w axis (in a plane parallel to the xw plane). What was the x axis will now lie along the vector from the origin to e.
  48.  
  49. That‚Äôs how it‚Äôs done, mathematically. As for intuitively, I confess that I am at an utter loss to imaging how one plane rotates around another with only one point of contact (the origin). I suppose it might be possible to fill in angles in Figure 2, but I doubt their locations would be particularly useful (it‚Äôs bad enough having that w axis hanging out there pretending to be perpendicular to the rest of them). In short, I don‚Äôt think it‚Äôs possible to understand hyperspherical coordinates; just use them. With proper manipulations of the [4:1], [4:2], and [4:3] controls, you can look at an object from any direction in four-space.
  50.  
  51. The first version of HyperCuber actually used names like Alpha and Theta for its angles. This naming convention, while convenient in some ways, was quite inextensible to arbitrary dimensions. HyperCuber now names its angles [d:a] where d is the dimension and a is the angle. So instead of Theta for the first rotation angle of the three-dimensional viewpoint, HyperCube now uses [3:1].
  52.  
  53. Five-dimensional and higher-dimensional viewpoints can be described similarly; all you need is one more angle. In general it takes n-1 angles to describe an n-dimensional viewpoints.  
  54.  
  55.  
  56. Projections
  57. HyperCuber performs a series of projections when it draws an n-dimensional object. The first is done in n-space, when it projects the n-dimensional object onto an (n-1)-dimensional space. Next it takes this (n-1)-dimensional projection and projects it onto an (n-2)-dimensional space. This continues until the projection from three-space to two-space, when the object is finally projected onto a plane (the computer screen) where it can immediately be drawn.
  58.  
  59. The three-dimensional to two-dimensional projection is similar to projections done by most three-dimensional modeling programs. The three-dimensional viewpoint is define using spherical coordinates, [3:1] for horizontal angle, [3:2] for elevation (see HyperCuber Viewpoints). The projection is done by finding a projecting plane perpendicular to the viewing vector (the vector from the viewpoint to the center of the object), somewhere between the viewpoint and the object. Then for each point to be drawn, we construct a line segment (blue in Figure 3) between that point and the eye, and find the intersection of that segment with the projecting plane. This intersection point is converted to a two-dimensional point (the position of the point on the projecting plane), and this point is used to draw on the screen (see Figure 3).
  60.  
  61.  ¬†
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. Projection works similarly in the four-dimensional to three-dimensional case. We find a three-dimensional ‚Äúscreen‚Äù (the projection cube) which is between the view point e and the center of the object, and which is perpendicular to the vector connecting e and the center of the object. For each point in the object, we find the intersection of the vector connecting the point to e, and the projection cube. This point, being inside the projection cube, can be considered to be three-dimensional point. More precisely, since the projection cube is a three-dimensional object in a four-dimensional space, it lies entirely in some three-space within the four-space. Thus, for some coordinate system, every point in the projection cube has the same fourth coordinate. We can thus discard this fourth coordinate for each point in the projection, yielding a three-dimensional object. This object is the three-dimensional projection (see Figure 4).
  78.  
  79. Note that in Figure 4, the hypercube on the left is a four-dimensional object; each point has four coordinates associated with it. The hypercube inside the projection cube, however, is a three-dimensional object (contained entirely in one three-space). This is analogous to the situation in Figure 3, where the leftmost object is truly three-dimensional, but the center object, inside the projection screen, is a two-dimensional object (contained entirely in one plane). Note also that Figure 4 itself is just a two-dimensional drawing. Thus, to draw the projection cube for the illustration, it was necessary to put it through a three-dimensional to two-dimensional projection. To draw the hypercube on the left, it was necessary to apply both a four-to-three dimensional projection and a three-to-two dimensional projection. This is precisely the sort of thing HyperCuber does, and in fact both hypercubes in Figure 3 were made by HyperCuber.
  80.  
  81.  ¬†
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97. The higher-dimensional projections should follow naturally, and I have no intention of attempting to draw a five-dimensional or n-dimensional projection on this two-dimensional document, since it would be even more meaningless than Figure 3.
  98.  
  99. HyperCuber also allows you to vary the perspective used in the projection for any dimension. This essentially varies the influence of distance on the shape of an object. We expect that the same object, when closer, will be larger. When perspective is set to a large value, this is true, and nearby things become even larger as you increase the perspective. If perspective is set to zero, an object will be the same size regardless of distance. [n:P] controls the amount of n-dimensional perspective. Turning perspective to a low value is like retreating to a great distance, so that the distances between the faces of the object are relatively small compared to the viewing distance. Turning perspective to a high value is like looking very closely, or with a wide-angle lens; it can yield rather comic results. Note that the object is magnified so that it always appears to be the same size.
  100.  
  101. Three-dimensional perspective is what makes the front face of a cube look larger than the back face. Similarly, four-dimensional perspective is what makes the front face of a hypercube look larger than the back face. Since faces of hypercubes are cubes, it makes some cubes look larger than others. In Figure 3, for example, the hypercube on the left looks like a small cube inside a larger cube. This is four-dimensional perspective at work; the large cube is the closest face in four-space to the eye point.